﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Default.Master" Inherits="System.Web.Mvc.ViewPage<WebStickyNotes.Models.TaskPersonIndexModel>" %>
<%@ Import Namespace="WebStickyNotes.Resources" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Labels.PageTitlePeople %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <article>
        <header>
            <h2><%= Labels.PageTitlePeople %></h2>
        </header>
        <section>
            <div id="taskpeople" class="hastable">
                <table>
                    <thead>
                        <tr>
                            <th><%= Labels.Name %></th>
                            <th><%= Labels.Email %></th>
                            <th><%= Labels.TaskRole %></th>
                            <th><%= Labels.ToDo %></th>
                            <% if (Model.CurrentUser.TaskRoleId == 1) { %>
                            <th><%= Labels.Edit %></th>
                            <th><%= Labels.Delete %></th>
                            <% } %>
                        </tr>
                    </thead>
                    <tbody>
                    <% foreach (var taskPerson in Model.TaskPersons) { %>
                        <tr>
                            <td><%= Html.ActionLink(taskPerson.FirstName + " " + taskPerson.LastName, "TasksForPerson", "TaskDetail", new { id = taskPerson.Id }, null)%></td>
                            <td><%= taskPerson.Email %></td>
                            <td><%= taskPerson.TaskRoleId %></td>
                            <td><%= Html.ActionLink(Labels.ToDo, "ToDoList", "TaskDetail", new { id = taskPerson.Id }, null) %></td>
                            <% if (Model.CurrentUser.TaskRoleId == 1) { %>
                            <td><%= Html.ActionLink("Edit", "Edit", new { id = taskPerson.Id }, new { @class = "button" })%></td>
                            <td><%= Html.ActionLink("Delete", "Delete", new { id = taskPerson.Id }, new { @class = "button" })%></td>
                            <% } %>
                        </tr>
                    <% } %>
                    </tbody>
                </table>
            </div>
        </section>
        <footer>
            <%= WebStickyNotes.Helpers.PagingHelper.ShowPageLinks(Model.PagingLink, "pages", Model.CurrentPage, Model.PageSize, Model.TotalRecords) %>
        </footer>
    </article>
</asp:Content>

<asp:content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
</asp:content>